
*******
*Replication codes “Replacing and Amending Constitutions.The Logic of Constitutional Change in Latin America”, Law & Society Review, 2012, 46 (4): 749-779.
*Gabriel L. Negretto
*******



stset t, id (id) time0 (t0) failure (fail)

stcox constcrisis transition partychange amendrate adjudication electshare instshare origins legacy diffusion  growth inflation if  enforcement_code ==1 , cluster (country_code) efron nohr


stcox constcrisis transition partychange vetopoint adjudication electshare instshare origins legacy diffusion growth inflation if  enforcement_code ==1 , cluster (country_code) efron nohr


stcox constcrisis transition partychange vetopoint adjudication electshare instshare origins legacy diffusion  growth inflation if  enforcement_code ==1 , cluster (country_code) efron nohr   scaledsch(sca*) schoenfeld(sch*) 


stphtest, rank detail


tsset countrycode years

xtdes

gen loglength = ln(length)

gen intervetoenp = vetopoint* enpseats


xttobit amendrate detail vetopoint enpseats if enforcement_code == 1, re 

xttobit amendrate detail vetopoint enpseats intervetoenp if enforcement_code == 1, re 

xttobit amendrate  detail vetopoint enpseats intervetoenp  constcrisis transition partychange electshare  instshare adjudication   growth  inflation if  enforcement_code == 1, re

xttobit amendrate loglength vetopoint enpseats if enforcement_code == 1, re 

xttobit amendrate loglength vetopoint enpseats intervetoenp if enforcement_code == 1, re 

xttobit amendrate  loglength vetopoint enpseats intervetoenp  constcrisis transition partychange electshare  instshare adjudication  growth  inflation if  enforcement_code== 1, re



*Marginal Effect of the Stringency of Amendment Procedures as Party System Fragmentation Increases

xttobit amendrate  vetopoint enpseats intervetoenp detail if enforcement_code == 1, re 


*Figure

generate MV=(( _n-1)/10)
replace MV=. if _n >93

matrix b=e(b)
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1]
scalar varb2=V[2,2]
scalar varb3=V[3,3]
scalar covb1b3=V[1,3]
scalar covb2b3=V[2,3]


gen conb=b1+b3*MV if _n < 93

*calculating standard errors
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n < 93

*calculating confidence interval

gen a=1.96*conse

gen upper=conb+a

gen lower=conb-a

*Figure with confidence interval as legend 
graph twoway line conb MV, clwidth(medium) clcolor(blue) clcolor(black) || line upper MV, clpattern(dash) clwidth(thin) clcolor(black)|| line lower MV, clpattern(dash) clwidth(thin) clcolor(black) || ,yline(0, lcolor(black)) xlabel (1 2 3 4 5 6 7 8 9)legend (col (1)  order ( 2) label( 1 " ") label (2 "95% confidence interval" " ")  ) xtitle( Effective Number of Parties, size(4) ) ytitle("Marginal Effect of the Stringency" "of Amendment Procedures", size(4)) xsca(titlegap(2)) ysca(titlegap(2))



